package com.jwsoft.manager.core.dao.service.impl;

import com.jwsoft.manager.core.dao.model.EduSyncZjDelete;
import com.jwsoft.manager.core.dao.mapper.EduSyncZjDeleteMapper;
import com.jwsoft.manager.core.dao.model.EduSyncZjEnroll;
import com.jwsoft.manager.core.dao.service.EduSyncZjApplyService;
import com.jwsoft.manager.core.dao.service.EduSyncZjApproveService;
import com.jwsoft.manager.core.dao.service.EduSyncZjDeleteService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jwsoft.manager.core.dao.service.EduSyncZjEnrollService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 省报名审核专库同步情况表服务实现类
 *
 * @author chenzh
 * @since 2023-07-25
 */
@Service
public class EduSyncZjDeleteServiceImpl extends ServiceImpl<EduSyncZjDeleteMapper, EduSyncZjDelete> implements EduSyncZjDeleteService {

    @Autowired
    private EduSyncZjEnrollService enrollService;

    @Autowired
    private EduSyncZjApproveService approveService;

    @Autowired
    private EduSyncZjApplyService applyService;

    @Override
    public void deleteByTypeAndId(String deleteType, Long deleteId) {
        if ("1".equalsIgnoreCase(deleteType)){
            //删除报名表数据
            applyService.removeById(deleteId);
        }else if ("2".equalsIgnoreCase(deleteType)){
            approveService.removeById(deleteId.toString());
        } else if ("3".equalsIgnoreCase(deleteType)){
            enrollService.removeById(deleteId.toString());
        }
    }
}
